from django.db import models

# Create your models here.
from common.models import Person


class Detail(models.Model):
    title = models.CharField(max_length=50, verbose_name="标题")
    person = models.ForeignKey(to=Person, verbose_name="报销人", on_delete=models.CASCADE)
    account = models.DecimalField(verbose_name="金额", max_digits=99999, decimal_places=2)
    time = models.DateField(verbose_name="报销时间")
    content = models.TextField(verbose_name="备注详情", blank=True, null=True)

    def __str__(self):
        return str(self.title)

    class Meta:
        ordering = ('-pk',)
        verbose_name = '报销详情'
        verbose_name_plural = verbose_name
